package com.tools.pojo.test;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Getter
@Setter
public class AnalysisResult {


    private boolean success;

    private String message;

    private List<RuleMatchResult> matchResults = new ArrayList<>();

    private Map<String, Object> summary;

    private long processingTime;

    private int totalRecords;

    private int matchedRecords;

    private int totalRules;

    private int matchedRules;

    public void addMatchResult(RuleMatchResult result) {
        matchResults.add(result);
    }

    public int getTotalRules() {
        return matchResults.size();
    }

    public int getMatchedRules() {
        return (int) matchResults.stream()
                .filter(RuleMatchResult::isMatched)
                .count();
    }

}
